//
//  DetailsTableViewCell.m
//  片刻
//
//  Created by lanou3g on 15/6/5.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "DetailsTableViewCell.h"
#import "MaocHeader.h"
#import "UIImageView+WebCache.h"
@implementation DetailsTableViewCell

-(void)dealloc
{
    _model = nil;
    _backimage = nil;
    _title = nil;
    _vistlabel1 = nil;
    _button = nil;
    [super dealloc];
}

- (void)awakeFromNib {
    // Initialization code
}


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self= [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {


        _backimage = [[UIImageView alloc] initWithFrame:CGRectMake(10, 5, 40, 40)];
        [self.contentView addSubview:_backimage];
        _title = [[UILabel alloc] initWithFrame:CGRectMake(52, 5, SCREEN_WIDTH - 50, 20)];
        _title.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:_title];
        _vistlabel1 = [[UILabel alloc] initWithFrame:CGRectMake(65, 30, 100, 20)];
        _vistlabel1.font =[UIFont systemFontOfSize:13];
        [self.contentView addSubview:_vistlabel1];
//        _button = [UIButton buttonWithType:(UIButtonTypeSystem)];
//        _button.frame = CGRectMake(SCREEN_WIDTH - 40, 15, 20, 20);
//        [_button addTarget:self action:@selector(handleButtonAction:) forControlEvents:(UIControlEventTouchUpInside)];
//        _button.backgroundColor = [UIColor orangeColor];
//        [self.contentView addSubview:_button];
        self.player = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"player"]];
        _player.frame = CGRectMake(SCREEN_WIDTH - 40, 15, 20, 20);
        [self.contentView addSubview:_player];
        
        self.wifi = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"wifi"]];
        self.wifi.frame = CGRectMake(52, 33, 13, 13);
        [self.contentView addSubview:_wifi];
        
        [_backimage release];
        [_title release];
        [_vistlabel1 release];
        [self.player release];
        [self.wifi release];


        

    }
    return self;
}

//-(void)handleButtonAction:(UIButton *)button{
//    //点击播放
//}

-(void)setModel:(RadioModel *)model{
    if (_model != model) {
        [_model release];
        _model = [model retain];
        
        [_backimage sd_setImageWithURL:[NSURL URLWithString:model.coverimg]];
        _title.text = model.title;
        _vistlabel1.text = model.musicVisit;
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end




